<template>
  <div>
    <el-drawer
      title="跟进记录"
      :visible.sync="dialogVisible"
      :direction="direction"
      size="50%"
    >
      <el-form label-width="80px" class="ip">
        <div class="list" v-for="(item, index) in list" :key="index">
          <div class="contds">
            <div class="create">
              <span>{{ item.createTime }}</span>
              <span>跟进人:{{ item.name }}</span>
            </div>
            <div class="type" v-if="item.type == 3">写跟进</div>
            <div class="type" v-if="item.type == 0">新建客户</div>
            <div class="type" v-if="item.type == 2">拜访签到</div>
            <div class="type" v-if="item.type == 4">编辑客户</div>
            <div class="type" v-if="item.type == 5">添加协作人</div>
            <div class="type" v-if="item.type == 6">创建计划</div>
            <div class="type" v-if="item.type == 7">领取客户</div>
           <div>{{item.content}}</div>
            <div v-if="item.img != null" class="images">
              <img
                :src="item"
                alt=""
                v-for="(item, index) in item.img"
                :key="index"
              />
            </div>
            <div class="audio"   v-for="(it, index) in item.ivr" :key="index">
              <audio :src="it"  controls="controls" />
            </div>
          </div>
        </div>
      </el-form>
    </el-drawer>
    <!-- <el-dialog title="跟进记录" :visible.sync="dialogVisible" width="50%">
      <el-form label-width="80px">
        <div class="list" v-for="(its, index) in list" :key="index">
          <div class="contds">
            <div class="create">
              <span>{{ its.createTime }}</span>
              <span>跟进人:{{ its.name }}</span>
            </div>
            <div class="type" v-if="its.type == 3">写跟进</div>
            <div class="type" v-if="its.type == 0">新建客户</div>
            <div class="type" v-if="its.type == 2">拜访签到</div>
            <div class="type" v-if="its.type == 4">编辑客户</div>
            <div class="type" v-if="its.type == 5">添加协作人</div>
            <div class="type" v-if="its.type == 6">创建计划</div>
            <div class="type" v-if="its.type == 7">领取客户</div>
            <div v-if="its.img != null" class="images">
              <img
                :src="item"
                alt=""
                v-for="(item, index) in its.img"
                :key="index"
              />
            </div>
            <div v-if="its.ivr != null">
              <audio :src="ivr" v-for="(item, index) in its.ivr" :key="index" />
            </div>
          </div>
        </div>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleOk">确 定</el-button>
      </span>
    </el-dialog> -->
  </div>
</template>

<script>
import { getList } from "@/api/record";
import { getSoList } from "@/api/set";
export default {
  name: "edit",
  data() {
    return {
      dialogVisible: false,
      imageUrl: "",
      //   跟进数组
      list: [],
      listivr: [],
      //  drawer: false,
      direction: "rtl"
    };
  },
  methods: {
    showOne(e) {
      this.dialogVisible = true;
      //   this.form.id = e;
      let a = {
        id: e
      };
      getList(a).then(res => {
        if (res.status === 200) {
          this.list = res.result;
             }
      });
    },
    handleOk() {
      update(this.form).then(res => {
        if (res.status === 200) {
          this.$emit("Ok");
          this.dialogVisible = false;
          this.$message.success("编辑成功");
        }
      });
    },
    Change1(e) {
      console.log(e);
      this.form.sex = e;
    },
    Change2(e) {
      console.log(e);
      this.form.fid = e;
    }
  }
};
</script>

<style scoped>
.ip{
  width: 100%;
  height: 700px;
  overflow-y: scroll;
}
.images img {
  width: 100px;
  height: 100px;
  /* width: 100%; */
}
.list {
  width: 95%;
  margin: 10px auto;
  /* border: 1px solid magenta; */
}
.create {
  font-size: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.contds {
  width: 100%;
  background-color: #eff3ff;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 14px;
}
.contds .type {
  font-size: 16px;
  margin: 12px 0;
}

</style>
